package okw.gui;

import org.eclipse.swt.SWT;
import org.eclipse.swt.events.SelectionEvent;
import org.eclipse.swt.events.SelectionListener;
import org.eclipse.swt.widgets.Button;
import org.eclipse.swt.widgets.Group;
import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.swt.widgets.Text;

public class GenWindow {
	public Shell shell = null; 
	
	
	public GenWindow(Shell parent){
		shell = new Shell(parent, SWT.TITLE|SWT.SYSTEM_MODAL| SWT.CLOSE | SWT.MAX);
	    shell.setText("Podaj nazwe plikow");
	    shell.setSize(300, 200);
	    MainWindowO.center(shell);
	    
	    Group dane = new Group(shell, SWT.SHADOW_ETCHED_IN);
		dane.setLocation(5,5);
		dane.setSize(285,365);
	    
	    Label label3 = new Label(dane, SWT.LEFT);
	    label3.setText("Podaj nazwe: ");
	    label3.setSize(100, 20);
	    label3.setLocation(100, 20);
	    
	    final Text poleTxt = new Text(dane, SWT.LEFT | SWT.BORDER);
	    poleTxt.setSize(150,20);
	    poleTxt.setLocation(70,45);
	    poleTxt.setTextLimit(10);
	    
	    final Button generuj = new Button(dane, SWT.PUSH);
	    generuj.setText("Generuj");
	    generuj.setLocation(70,80);
	    generuj.setSize(150,20);

	    generuj.addSelectionListener(new SelectionListener() {
			
			public void widgetSelected(SelectionEvent arg0) {
				
				shell.close();
			}
			
			public void widgetDefaultSelected(SelectionEvent arg0) {
				
				
			}
		});
		
	    shell.open();
	}
	
	

}
